import {findAll} from '@/api/comment.js'
export default {
    namespaced:true,
    state:{
        //后台总数据
        totalData:{},
    },
    //对数据进行拆分
    getters:{
        total:state=>state.totalData.total,
        commentData:state=>state.totalData.list,
    },
    mutations:{
        changeTotalData(state,data){
            state.totalData=data;
        }
    },
    actions:{
        findAll({commit},payload){
            findAll(payload).then(res=>{
                commit('changeTotalData',res.data)
            })
        }
    }
}